package pku.constant;

import pku.MessageHeader;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class MessageHeaderMap {

    public final static String[] headerKeys = {
            MessageHeader.MESSAGE_ID, MessageHeader.TIMEOUT, MessageHeader.PRIORITY, MessageHeader.RELIABILITY,
            MessageHeader.BORN_TIMESTAMP, MessageHeader.STORE_TIMESTAMP, MessageHeader.START_TIME,
            MessageHeader.STOP_TIME, MessageHeader.SHARDING_KEY, MessageHeader.SHARDING_PARTITION,
            MessageHeader.BORN_HOST, MessageHeader.STORE_HOST, MessageHeader.SEARCH_KEY,
            MessageHeader.SCHEDULE_EXPRESSION, MessageHeader.TRACE_ID
    };

    public final static Map<String, Integer> key2no = new HashMap<>();

    static {
        for (int i = 0; i < headerKeys.length; i++) {
            key2no.put(headerKeys[i], i);
        }
    }

}
